#pragma once

#include <scslot.h>

#include <SCItemSlot.h>

class TradeSlot : public SCSlot
{
public:
	TradeSlot(void);
	virtual ~TradeSlot(void);

	virtual VOID			Clear(){ if(m_pItemSlot) m_pItemSlot->SetLock(FALSE);  m_pItemSlot = NULL; }
	virtual VOID			Copy( SCSlot & IN slot );

	virtual eSlotType		GetSlotType() const	{ return m_pItemSlot->GetSlotType();}
	virtual DBSERIAL		GetSerial() const	{ if( !m_pItemSlot) return 0; return m_pItemSlot->GetSerial();}
	virtual SLOTCODE		GetCode() const		{ return m_pItemSlot->GetCode();}
	virtual DURATYPE		GetNum() const		{ return m_pItemSlot->GetNum();}


	VOID SetLinkItem( SCItemSlot * pItem )		{ if(pItem) pItem->SetLock(TRUE); if(m_pItemSlot) m_pItemSlot->SetLock(FALSE);	m_pItemSlot = pItem; }
	SCItemSlot * GetLinkItem()					{ return m_pItemSlot;	}

private:
	SCItemSlot *			m_pItemSlot;
};
